<html>
    <head>
        <title>这是我的账号</title>
    </head>
        <script src="/jquery/jquery.js"></script>
        <script src="/layui/layui.js"></script>
    <body style="background:#F4F4F4";>
        <center>
          <div style="background:#FFFFFF;margin-top:250px;">
              <h1>请在下方修改你的账号噢</h1>
              <form action="" method="post" id="form">
                   @csrf
                    <span style="font-size:23px;"> 账号：</span><input type="text" name="aa" id="account" value="{{$row->account}}" style="width:300px;height:50px;"/><br/><br/>
                       <input type="submit" value="提交"  id="submit" style="width:200px;height:30px;margin-left:65px">
              </form>
          </div>
       </center>
    </body>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <script>
        $(function(){
            $('#submit').click(function () {
              $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    });
                var form = $('#form').serialize();
                var account =  $('#account').val();

                layui.use('layer', function() {
                    var layer = layui.layer;
                    if (!account) {
                        layer.msg('账号名不能为空');
                        location.href = '/dind_out';
                        return false;
                        exit;
                    }
                    if (account.length<9) {
                       layer.msg('账号长度不能小于9位');
                        location.href = '/dind_out';
                        return false;
                       exit;//1
                        // layer.msg('账号不能小于5位');
                        // location.href = '/dind_out';
                        // return false;
                    }else if (account.length>10) {
                       layer.msg('账号长度不能大于10位');
                        location.href = '/dind_out';
                        return false;
                       exit;
                        // layer.msg('账号不能小于5位');
                        // location.href = '/dind_out';
                        // return false;
                    }else
                    {
                        $.get({
                                            url:"dind_yes",
                                            data: form,
                                            success:function (data) {
                                                layui.use('layer', function(){
                                                    var layer = layui.layer;
                                                    if(data.code=='1') {
                                                        layer.open({
                                                            title: '账号'
                                                            , skin: 'msg'
                                                            , content: data.name
                                                            , yes: function () {
                                                                location.href = data.url;
                                                        }
                                                     });
                                                    }else if(data.code=='-1'){
                                                        layer.open({
                                                            title: '账号'
                                                            , skin: 'msg'
                                                            , content: data.name
                                                            , yes: function () {
                                                                location.href = '/dind_out';
                                                            }
                                                        });
                                                    }
                                                });
                                            }
                                        });
                    }
                    // if (account.length>10) {
                    //     layer.msg('账号不能大于10位');
                    //     location.href = '/dind_out';
                    //     return false;
                    // }
                });

                return false;
            });
        });
    </script>
</html>
